package com.sojson.websocket.util.enums;

import com.sojson.util.HexUtil;

/**
 * WebSocket获取数据类型枚举类
 *
 * @author liu
 * @date 2021-04-12
 */
public enum EWebSocketGetDataType {

    /** 获取使用量数据 */
    DOSAGE("获取使用量数据", "00010000"),
    /** 获取状态字 */
    STATUS("获取状态字", "04000503");

    /** 功能名称 */
    private final String name;
    /** 功能代码 */
    private final String code;
    /** 添加0x33 */
    private final String addThirtyThree;
    /** 添加0x33反转 */
    private final String addThirtyThreeReverse;

    EWebSocketGetDataType(String name, String code) {
        this.name = name;
        this.code = code;
        this.addThirtyThree = HexUtil.addThirtyThree(code);
        this.addThirtyThreeReverse = HexUtil.reverse(addThirtyThree);
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public String getAddThirtyThree() {
        return addThirtyThree;
    }

    public String getAddThirtyThreeReverse() {
        return addThirtyThreeReverse;
    }

}